import requests

import json

def get_translate_date(word=None):
    url = 'http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'

    From_data = {'i': '你好世界', 'from': 'AUTO', 'to': 'AUTO', 'smartresult': 'dict', 'client': 'fanyideskweb',
                 'salt': '16127609828639', 'sign': 'fd274084026384c9fba9da1fb4a6c47a', 'lts': '1612760982863',
                 'bv': '3d91b10fc349bc3307882f133fbc312a', 'doctype': 'json', 'version': '2.1', 'keyfrom': 'fanyi.web',
                 'action': 'FY_BY_CLICKBUTTION'}

    #请求表单数据
    response = requests.post(url,data=From_data)

    #将json格式字符串转字典
    content = json.loads(response.text)
    print(content)

if __name__ == '__main__':
    get_translate_date('你好世界')